import request from '@/utils/request'


// 机构详情
export const get_site_detail = id => {
    return request({
        url: `/organization/${id}`,
        method: 'get'
    })
}

// 获取当前助老员信息
export const get_current_zly = params => {
    return request({
        url: `/seniorAssistantinfo/getDetailByCurrentAccount`,
        method: 'get',
        params
    })
}


// 改变机构运营状态
export const change_status = (url, data) => {
    return request({
        url,
        method: 'post',
        data
    })
}


// 获取机构下拉及列表
export const get_org_options = params => {
    return request({
        url: '/organization',
        method: 'get',
        params
    })
}

// 获取助老员档案列表
export const get_people_list = params => {
    return request({
        url: '/seniorAssistantinfo',
        method: 'get',
        params
    })
}

// 获取活动列表
export const get_activity_list = params => {
    return request({
        url: '/operationActivity/listPage',
        method: 'get',
        params
    })
}

// 新建机构
export const save_site = data => {
    return request({
        url: '/organization',
        method: 'post',
        data
    })
}

// 新建助老员
export const save_zly = data => {
    return request({
        url: '/seniorAssistantinfo/save',
        method: 'post',
        data
    })
}

// 助老员详情
export const get_zly_detail = id => {
    return request({
        url: `/seniorAssistantinfo/${id}`,
        method: 'get'
    })
}

// 助老员离职复职
export const change_status_job = data => {
    return request({
        url: `/seniorAssistantinfo/saveStaffState`,
        method: 'put',
        data
    })
}

// 删除助老员
export const del_zly_list = id => {
    return request({
        url: `/seniorAssistantinfo/${id}`,
        method: 'delete'
    })
}

// 删除活动
export const del_activity_list = id => {
    return request({
        url: `/operationActivity/${id}`,
        method: 'delete'
    })
}

// 新建活动
export const save_hdgl = data => {
    return request({
        url: '/operationActivity',
        method: 'post',
        data
    })
}


// 获取活动管理详情
export const get_activity_detail = id => {
    return request({
        url: `/operationActivity/${id}`,
        method: 'get'
    })
}

// 新建活动
export const edit_hdgl = data => {
    return request({
        url: '/operationActivity',
        method: 'put',
        data
    })
}

// 获取长者档案列表
export const get_zzda_list = params => {
    return request({
        url: '/seniorElder',
        method: 'get',
        params
    })
}

// 获取长者档案注销列表
export const get_zzda_cancel_list = params => {
    return request({
        url: '/seniorElder/cancelPage',
        method: 'get',
        params
    })
}

// 获取长者档案详情
export const get_zzda_detail = id => {
    return request({
        url: `/seniorElder/${id}`,
        method: 'get'
    })
}

// 删除长者档案
export const del_zzda_list = id => {
    return request({
        url: `/seniorElder/${id}`,
        method: 'delete'
    })
}

// 长者档案注销
export const cancel_zzda = data => {
    return request({
        url: `/seniorElder/cancellation`,
        method: 'put',
        data
    })
}

// 长者档案撤销
export const cancel_zzda_back = data => {
    return request({
        url: `/seniorElder/revokeSeniorElder`,
        method: 'put',
        data
    })
}

// 长者档案撤销注销
export const back_cancel_zzda = data => {
    return request({
        url: `/seniorElder/revokeSeniorElder`,
        method: 'put',
        data
    })
}

// 新建长者档案
export const save_zzda = data => {
    return request({
        url: '/seniorElder/save',
        method: 'post',
        data
    })
}

// 志愿者选择
export const get_zyz_list_select = params => {
    return request({
        url: '/volunteer/list',
        method: 'get',
        params
    })
}

// 紧急援助列表
export const get_jjyz_list = params => {
    return request({
        url: '/operationAid/listPage',
        method: 'get',
        params
    })
}

// 删除紧急援助列表
export const del_jjyz_list = id => {
    return request({
        url:`/operationAid/${id}`,
        method: 'delete'
    })
}

// 紧急援助列表详情
export const get_jjyz_detail = id => {
    return request({
        url:`/operationAid/${id}`,
        method: 'get'
    })
}

// 添加紧急援助
export const save_jjyz = data => {
    return request({
        url:`/operationAid`,
        method: 'post',
        data
    })
}

// 编辑紧急援助
export const edit_jjyz = data => {
    return request({
        url:`/operationAid`,
        method: 'put',
        data
    })
}

// 典型案例列表
export const get_dxal_list = params => {
    return request({
        url: '/operationCase/listPage',
        method: 'get',
        params
    })
}

// 删除典型案例列表
export const del_dxal_list = id => {
    return request({
        url:`/operationCase/${id}`,
        method: 'delete'
    })
}

// 紧急典型案例详情
export const get_dxal_detail = id => {
    return request({
        url:`/operationCase/${id}`,
        method: 'get'
    })
}

// 添加典型案例
export const save_dxal = data => {
    return request({
        url:`/operationCase`,
        method: 'post',
        data
    })
}

// 编辑典型案例
export const edit_dxal = data => {
    return request({
        url:`/operationCase`,
        method: 'put',
        data
    })
}

// 删除需求管理列表
export const del_xqgl_list = id => {
    return request({
        url:`/operationNeed/${id}`,
        method: 'delete'
    })
}

// 紧急需求管理详情
export const get_xqgl_detail = id => {
    return request({
        url:`/operationNeed/${id}`,
        method: 'get'
    })
}

// 添加需求管理
export const save_xqgl = data => {
    return request({
        url:`/operationNeed`,
        method: 'post',
        data
    })
}

// 编辑需求管理
export const edit_xqgl = data => {
    return request({
        url:`/operationNeed`,
        method: 'put',
        data
    })
}

// 需求管理列表
export const get_xqgl_list = params => {
    return request({
        url: '/operationNeed/listPage',
        method: 'get',
        params
    })
}

// 入户拜访列表
export const get_rhbf_list = params => {
    return request({
        url: '/visit/listPage',
        method: 'get',
        params
    })
}
